package com.bto.solar.work.controller;

import com.bto.solar.work.common.R;
import com.bto.solar.work.dao.IBeneficiaryCompanyService;
import com.bto.solar.work.dao.IInsuranceCompanyService;
import com.bto.solar.work.dao.IInsuranceService;
import com.bto.solar.work.entity.BeneficiaryCompany;
import com.bto.solar.work.entity.Insurance;
import com.bto.solar.work.entity.InsuranceCompany;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 电站投保信息 前端控制器
 * </p>
 *
 * @author adrian
 * @since 2023-08-09
 */
@RestController
@RequestMapping("/insurance")
public class InsuranceController {

    @Autowired
    private IInsuranceCompanyService iInsuranceCompanyService;
    @Autowired
    private IBeneficiaryCompanyService iBeneficiaryCompanyService;

    @GetMapping("/getInsuranceCompany")
    public R<List<InsuranceCompany>> getInsuranceCompany() {
        List<InsuranceCompany> insuranceCompanies = iInsuranceCompanyService.lambdaQuery().list();
        return R.ok(insuranceCompanies);
    }

    @GetMapping("/getBeneficiaryCompany")
    public R<List<BeneficiaryCompany>> getBenficiaryCompany() {
        List<BeneficiaryCompany> beneficiaryCompanies = iBeneficiaryCompanyService.lambdaQuery().list();
        return R.ok(beneficiaryCompanies);
    }

}
